package com.example.opengl.render.image

import com.alibaba.android.arouter.facade.annotation.Route
import com.android.baselibrary.base.BaseActivity
import com.example.opengl.R
import com.example.opengl.databinding.ActivityOpenglRenderCircleBinding
import com.example.opengl.main.OpenGLPath
import com.example.opengl.render.rectangle.RectangleDrawer
import com.example.opengl.render.triangle.TriangleRender

/**
 * @author: Mr.You
 * @create: 2023-07-31 14:25
 * @description:渲染图片
 **/
@Route(path = OpenGLPath.OPENGL_RENDER_IMAGE)
class OpenGLRenderImageActivity:BaseActivity<ActivityOpenglRenderCircleBinding>() {
    override fun getLayoutId(): Int  = R.layout.activity_opengl_render_circle

    override fun initView() {
        mBinding.glSurface.run {
            setEGLContextClientVersion(2)
            setRenderer(TriangleRender().apply {
                addDrawerRender(ImageDrawer())
            })

        }
       // mBinding.glSurface.setRenderer(MyRender(this))
    }

    override fun onResume() {
        super.onResume()
        mBinding.glSurface.onResume()
    }

    override fun onPause() {
        super.onPause()
        mBinding.glSurface.onPause()
    }

    override fun initListener() {

    }
}